﻿using Microsoft.Extensions.Configuration;
using Utilities.AppSettingModels;

namespace Utilities
{
    /// <summary>
    /// 获取appsettings.json配置信息
    /// </summary>
    public class AppSetting
    {
        public AppSetting(ConfigurationManager configurationManager)
        {
            //ConfigurationBuilder configBuilder = new();
            //configurationManager.AddJsonFile("appsettings.json", true, true);
            //IConfigurationRoot configRoot = confi

            Config = configurationManager.GetSection("Config").Get<Config>();
            ConnectionStrings = configurationManager.GetSection("ConnectionStrings").Get<ConnectionStrings>();
            Auth = configurationManager.GetSection("Auth").Get<Auth>();


        }


        public static Config Config { get; set; }
        public static ConnectionStrings ConnectionStrings { get; set; }
        public static Auth Auth { get; set; }
    }
}
